package flatlandRPGTest;

import flatlandRPG.GamePanel;
import student.*;

// -------------------------------------------------------------------------
/**
 * Tests the game panel class.
 *
 * @author evan
 * @version May 1, 2011
 */
public class GamePanelTest
    extends GUITestCase
{
    private GamePanel gamePanel;


    public void setUp()
    {
        gamePanel = new GamePanel(800, 600);
        showInFrame(gamePanel);
    }


    // ----------------------------------------------------------
    /**
     * Tests that the constructor sets the window to the right size.
     */
    public void testConstructor()
    {
        assertEquals(810, gamePanel.getWidth());
        assertEquals(610, gamePanel.getHeight());
    }


    // ----------------------------------------------------------
    /**
     * Tests that the game properly runs.
     */
    public void testRun()
    {
        assertFalse(gamePanel.isRunning());

        gamePanel.run();

        assertTrue(gamePanel.isRunning());
    }
}
